Skip to content

NodeResourceTopology updates to match latest kubelet features #920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

ffromani
Copy link
Contributor

@ffromani ffromani commented Aug 1, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

implement support for relevant topology manager functionalities added since roughly 1.27.
Topology manager gained options similar to cpumanager. We begin the support implementing the scheduler equivalent of MaxAllowedNUMANodes.
detect sidecar containers
improve the logging again

Which issue(s) this PR fixes:

Fixes NA

Special notes for your reviewer:

Likewise the other topology manager settings, the value is node-local so it is better represented as NodeResourceTopology object property rather than a global configuration value.

Does this PR introduce a user-facing change?

Add support for Topology Manager MaxAllowedNUMANodes, detect sidecar containers, logging improvements.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Aug 1, 2025
Copy link

netlify bot commented Aug 1, 2025

Deploy Preview for kubernetes-sigs-scheduler-plugins canceled.

Name Link
🔨 Latest commit 0d3207a
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-scheduler-plugins/deploys/689c9091d411c900080100cb

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ffromani

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 1, 2025
@k8s-ci-robot k8s-ci-robot requested a review from zwpaper August 1, 2025 12:14
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 1, 2025
@ffromani
Copy link
Contributor Author

ffromani commented Aug 1, 2025

reviewers kindly ignore this PR until I remove the WIP

@ffromani ffromani changed the title WIP: NodeResourceTopology updates to match latest kubelet functionalities WIP: NodeResourceTopology updates to match latest kubelet features Aug 1, 2025
@ffromani ffromani force-pushed the nrt-update-202508 branch 2 times, most recently from 5351f4f to 791323d Compare August 1, 2025 13:35
add utilities to recognize sidecar containers,
and log them correctly.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani force-pushed the nrt-update-202508 branch from 791323d to a06d4c2 Compare August 1, 2025 15:48
Policy: "single-numa-node",
Scope: "container",
Policy: "single-numa-node",
MaxNUMANodes: 9, // grachopper
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, will fix in the next upload

add a helper struct to group together all the context
we need to carry in the internal implementation functions.
The goals are to streamline the existing code, to
reduce redundant call and to make room for more
arguments to be passed through, like the topology manager
configuration.

Signed-off-by: Francesco Romani <[email protected]>
similarly to what we did for filter, add a helper struct
to group together all the context we need to carry in the
internal implementation functions.
The goals are to streamline the existing code, to
reduce redundant call and to make room for more
arguments to be passed through, like the topology manager
configuration.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani force-pushed the nrt-update-202508 branch from a06d4c2 to 70a88d1 Compare August 4, 2025 14:12
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 4, 2025
Add more information, only at high verbosity levels,
about the filter behavior; report the precise
rejection reason, both in logs and in the user-visible record.
The user-visible record (e.g. in pod events) reported
in framework.Status must be concise, so we limit to a single
extra short word, being it the resource name.

Signed-off-by: Francesco Romani <[email protected]>
kubernetes 1.31 gained support for topology manager options,
and most notably to bump the limit of max NUMA nodes,
which is no longer hardcoded to 8.

Thus, we need to adapt the scheduler code.
Likewise other key topology manager parameters,
we trust NRT objects to carry the values we need.
In this case, to mitigate DoS risks, we set an artificial
"high enough" (and hopefully good enough for a while)
limit.

Once obtained the vlaue, we pass it through to all
the code places on which the previous hardcoded value was used.

Signed-off-by: Francesco Romani <[email protected]>
There is no de-duplication of key/value pairs by default
in go-logr or in klog, so we remove data which is not obviously
needed and which is likely to be provided, or already provided
in some other form (e.g. logger name) from the framework.

Signed-off-by: Francesco Romani <[email protected]>
we can use constants added in the helper package and
already available in the code we require.
No intended changes in behavior.

Signed-off-by: Francesco Romani <[email protected]>
@ffromani ffromani changed the title WIP: NodeResourceTopology updates to match latest kubelet features NodeResourceTopology updates to match latest kubelet features Aug 13, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 13, 2025
@ffromani
Copy link
Contributor Author

/hold

the PR is reviewable, I'm fine tuning the logs and checking for gaps (hence the hold). I can post a followup tuning later, but since this work is not especially urgent, I'd hold it for a little while and do all in one go.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants